package org.feng.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.NonNull;
import org.feng.entity.CommonDictionary;
import org.feng.mapper.CommonDictionaryMapper;
import org.feng.service.ICommonDictionaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 字典表 服务实现类
 * </p>
 *
 * @author fengjinsong
 * @since 2023-09-01
 */
@Service
public class CommonDictionaryServiceImpl extends ServiceImpl<CommonDictionaryMapper, CommonDictionary> implements ICommonDictionaryService {

    @Override
    public CommonDictionary selectOneByCode(@NonNull String code) {
        QueryWrapper<CommonDictionary> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(CommonDictionary::getCode, code);
        return this.getBaseMapper().selectOne(queryWrapper);
    }
}
